package com.simple.space.modules.base.pojo;

import javax.persistence.Transient;
import java.io.Serializable;

//@Entity
public class Base implements Serializable {

    private static final long serialVersionUID = 8688485941958668531L;

    @Transient
    protected Integer pageNum = 1;
    @Transient
    protected Integer pageSize = 20;
    @Transient
    protected Integer rows = 20;
    @Transient
    protected String orderSqlStr = "";
    
    @Transient
    protected Integer pageLimit = 20;
    @Transient
    protected Integer pageOffset = 0;
    
	public void setPageParam(Integer pageNum, Integer pageSize) {
		if (pageNum != null && pageSize != null) {
			this.pageLimit = pageSize;
			this.pageOffset = (pageNum - 1) * pageSize;
		}
	}

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getRows() {
        return rows;
    }

    public void setRows(Integer rows) {
        this.rows = rows;
    }

    public String getOrderSqlStr() {
        return orderSqlStr;
    }

    public void setOrderSqlStr(String orderSqlStr) {
        this.orderSqlStr = orderSqlStr;
    }

	public Integer getPageLimit() {
		return pageLimit;
	}

	public void setPageLimit(Integer pageLimit) {
		this.pageLimit = pageLimit;
	}

	public Integer getPageOffset() {
		return pageOffset;
	}

	public void setPageOffset(Integer pageOffset) {
		this.pageOffset = pageOffset;
	}
    
    
}
